package projectmanagement.web;

import org.springframework.web.servlet.mvc.Controller;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import projectmanagement.model.dao.ProjectDao;

import java.io.IOException;

public class ProjectListController implements Controller {

	private ProjectDao projectManager;

	public ModelAndView handleRequest(HttpServletRequest request,
			HttpServletResponse response) throws ServletException, IOException {

		ModelAndView modelAndView = new ModelAndView("projectList");

		modelAndView.addObject("projectList", this.projectManager
				.getProjectList());

		return modelAndView;
	}

	public ProjectDao getProjectManager() {
		return projectManager;
	}

	public void setProjectManager(ProjectDao projectManager) {
		this.projectManager = projectManager;
	}

}